import json

import pandas as pd

agent_orders_file_path = "C:\\Users\\yl2028\\Desktop\\ybrain\\数据预处理\\ymall_agent_goods_order1.xlsx"
ee_orders_file_path = "C:\\Users\\yl2028\Desktop\\ybrain\\数据预处理\\ymall_ee_goods_order1.xlsx"
vcs_project_file_path = "C:\\Users\\yl2028\\Desktop\\ybrain\\数据预处理\\ymall_crm_vcs_project.json"


# 读取代理商订单
def read_agent_orders():
    df = pd.read_excel(agent_orders_file_path)
    print(df)
    return df


# 读取企业订单
def read_ee_orders():
    df = pd.read_excel(ee_orders_file_path)
    print(df)


# 读取vcs项目列表
def read_vcs_project():
    vcs_project = json.load(
        open("C:\\Users\\yl2028\\Desktop\\ybrain\\数据预处理\\ymall_crm_vcs_project.json", encoding="utf-8"))
    project_list = vcs_project["RECORDS"]
    project_df = pd.DataFrame(project_list)
    print(project_df)
    # print("project_dataframe")
    # # 所有项目
    # print(project_df.iloc[0])
    # # 省报备项目排行榜
    # print("-----province top10------")
    # province_counts = sort_count(project_df,"province")
    # print(province_counts)
    # # 市项目排行榜
    # city_counts = sort_count(project_df, "city")
    # print("-----city top10------")
    # print(city_counts)
    # # 报备人员排行榜
    # manager_counts = sort_count(project_df, "manager_name", 10)
    # print("-----manager top10------")
    # print(manager_counts)
    # # 通过的报备项目
    # manager_counts = sort_count(project_df, "project_status", 10)
    # print("-----manager top10------")
    # print(manager_counts)
    # # 绘图
    # for x, y in zip(province_counts.keys(), province_counts.values):
    #     plt.text(x, y + 2, "%.0f" % y, ha="center", va="bottom", fontsize=12)
    # plt.bar(province_counts.keys(), province_counts.values, fc="r", tick_label=province_counts.keys())
    # plt.xlabel("省")
    # plt.ylabel("项目数量")
    # plt.title("各省报备项目数")
    # plt.show()


if __name__ == '__main__':
    '''
    报备企业降维PCA特征值
    报备企业相似度计算
    从订单过滤出付费用户报备项目ID列表
    
    '''
    agent_df = read_agent_orders()
    project_id_df = agent_df["project_id"]
    print(project_id_df)
    # projects = dict()




    # read_ee_orders()
